package com.bwie.mapper;

import com.bwie.common.domain.Lotto;
import com.bwie.common.domain.LottoLog;
import com.bwie.common.domain.Prize;
import com.bwie.common.domain.request.LottoLogListReq;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @className: LottoMapper
 * @Description: TODO
 * @version: v1.８.0
 * @author: 刘鑫
 * @date: 2025/8/31 17:47
 */
@Mapper
public interface LottoMapper {
    List<Lotto> lottoList(Lotto lotto);

    List<LottoLog> lottoLogList(LottoLogListReq lottoLogListReq);

    void add(Lotto lotto);

    Lotto selectLottoInfo(@Param("lottoId") Integer lottoId);

    Integer selectIntergrateByUserId(@Param("userId") Integer userId);

    Prize selectPrizeInfo(@Param("lottoId") Integer lottoId, @Param("number") double number);

    void insertUserInfoWincase(@Param("userId") Integer userId);




    void updateUserInfoPoints(@NotNull(message = "单次抽奖消耗积分不能为空") @Param("consumePoints") Integer consumePoints, @Param("userId") Integer userId);

    void addLog(LottoLog lottoLog);

    int decreaseInventory(Integer prizeId);

    List<Prize> selectPrize();

    List<Prize> findAll();

}
